//
//  TTabBarViewController.m
//  LoveShare
//
//  Created by ways on 2017/4/11.
//  Copyright © 2017年 tikeyc. All rights reserved.
//

#import "TTabBarViewController.h"
#import "TBaseNavigationViewController.h"

@interface TTabBarViewController ()<UITabBarControllerDelegate>

@property (nonatomic,strong) YWConversationListViewController *conversationListController;

@end

@implementation TTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.delegate = self;
    
    [self initTabBarProperty];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/



- (void)initTabBarProperty {
    UITabBarItem *home = self.tabBar.items[0];
    home.image = [home.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    home.selectedImage = [home.selectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    UITabBarItem *release = self.tabBar.items[1];
    release.image = [release.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    release.selectedImage = [release.selectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    UITabBarItem *user = self.tabBar.items[2];
    user.image = [user.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    user.selectedImage = [user.selectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    [[UITabBar appearance] setTintColor:[UIColor whiteColor]];
//    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];
    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor orangeColor], NSForegroundColorAttributeName, nil] forState:UIControlStateSelected];
    
    //
    self.selectedIndex = 2;
}

#pragma UITabBarControllerDelegate

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController NS_AVAILABLE_IOS(3_0){
    
    return YES;
}

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
//    NSLog(@"%lu",(unsigned long)tabBarController.selectedIndex);

}

@end
